package com.rzt.moredb.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.sql.Update;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@AllArgsConstructor
@Entity
@Table(name = "DB_MSG")
public class DbMsg {
    @Id
    @Column(name = "id")
    @NotNull(groups = Update.class)
    @ApiModelProperty(value = "ID", hidden = true)
    @GenericGenerator(name="idGenerator", strategy="uuid") //这个是hibernate的注解/生成32位UUID
    @GeneratedValue(generator="idGenerator")
    private String id;

    @ApiModelProperty(value = "消息")
    @Column(name = "msg")
    private String msg;

    @ApiModelProperty(value = "创建日期")
    @Column(name = "create_time")
    private Date createTime;


    public DbMsg() { }
}
